# $Id: PKGBUILD 85776 2013-03-07 02:00:54Z fyan $
# Maintainer: Felix Yan <felixonmars@gmail.com>
# Contributor: Ismael Carnales <icarnales at gmail dot com>
# Contributor: Sergey Mastykov <smastykov[at]gmail[dot]com>

_realname=pep8
pkgname=("$_realname-python2" "$_realname-python3")
pkgver=1.4.5
pkgrel=1
pkgdesc="Python style guide checker"
arch=('any')
url="http://github.com/jcrocholl/pep8/"
license=('custom:Expat')
makedepends=('python-distribute' 'python2-distribute')
source=("https://github.com/jcrocholl/$_realname/archive/${pkgver}.tar.gz")

build() {
  cd "$srcdir"
  cp -r $_realname-$pkgver $_realname-$pkgver-python2
}

package_pep8-python2() {
  depends=('python2')
  provides=('pep8')
  conflicts=('pep8')
  replaces=('pep8')
  
  cd "$srcdir/$_realname-$pkgver-python2"
  python2 setup.py install --prefix=/usr --root="$pkgdir/"
  mv "$pkgdir/usr/bin/pep8" "$pkgdir/usr/bin/pep8-python2"

  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

package_pep8-python3() {
  depends=('python3')
  
  cd "$srcdir/$_realname-$pkgver"
  python3 setup.py install --prefix=/usr --root="$pkgdir/"

  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

# vim:set ts=2 sw=2 et:
md5sums=('d4d33ab4318b64ae89967026e4f8ac4a')
